package org.cjlm.ui.api;

import org.cjlm.ui.pub.MInternalFrame;

import javax.swing.*;

public class PacketSenderFrame extends MInternalFrame {
    private JComboBox<String> protocol = new JComboBox<>(
        new String[]{"HTTP", "WebSocket", "TCP", "UDP"}
    );
    private JTextArea requestArea = new JTextArea();
    private JButton sendBtn = new JButton("发送");
    
    public PacketSenderFrame(String title, boolean max, int width, int height) {
        super(title, max, width, height);
        sendBtn.addActionListener(e  -> {
            switch (protocol.getSelectedItem().toString())  {
//                case "HTTP" -> sendHttpRequest();
//                case "TCP" -> sendTcpPacket();
                // 其他协议实现...
            }
        });
    }

    @Override
    public String getDefaultTile() {
        return "报文测试";
    }
}